package com.sskj.bibi.presenter;

import com.lzy.okgo.model.Response;
import com.sskj.bibi.http.HttpConfig;
import com.sskj.bibi.ui.activity.RecordActivity;
import com.sskj.common.base.HttpData;
import com.sskj.lib.http.JsonCallBack;

import java.util.List;
import java.util.Map;


public class RecordActivityPresenter extends BasePresenter<RecordActivity> {

    public void getAllCoin() {

        httpService.getAllCoin()
                .execute(new JsonCallBack<HttpData<Map<String, List<String>>>>() {
                    @Override
                    public void onSuccess(Response<HttpData<Map<String, List<String>>>> response) {
                        HttpData<Map<String, List<String>>> httpData = response.body();
                        if (httpData.getStatus() == HttpConfig.OK) {
                            mView.updateCoinAll(httpData.getData());
                        }
                    }

                    @Override
                    public void onError(Response<HttpData<Map<String, List<String>>>> response) {
                        super.onError(response);
                    }
                });
    }
}
